from selenium import webdriver
from time import sleep

from selenium.webdriver.common.by import By

"""
浏览器操作
"""
driver = webdriver.Chrome()
sleep(2)
driver.get("http://www.baidu.com")
sleep(2)
#1.设置浏览器大小
# driver.set_window_size(500,500)
# sleep(2)
# #2.最大化
driver.maximize_window()
sleep(2)
#3.最小化
# driver.minimize_window()
# sleep(2)
#4.前进后退
# driver.find_element(By.ID,"kw").send_keys("刘德华")
# sleep(2)
# driver.find_element(By.ID,"su").click()
# sleep(2)
# driver.back()
# sleep(2)
# driver.forward()
# sleep(2)
#5.标题，网址
print(driver.title)
print(driver.current_url)
#6.退出 close关闭当前页面,quiet 浏览器
driver.close()
driver.quit()